Fix MML 1537: cannot load sv blk files missing armor type field #5634
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MM side of fix for various NPEs and loading issues in MegaMek/megameklab#1537.
Fix replaces a magic number in the BLK save code with a defined constant; the code was skipping Standard armor on SVs with Armored Chassis mod and leaving them in an un-loadable state since 0.49.19.
This also adds some handling for fields that had become mismatched between the old SV blk save code and the new loadSV() code, specifically, 'armor_tech[_rating]' which was using the long form to save and the short form to load, leading to undefined behavior.
Finally, there is an MML PR to disable the Armor Tech Rating chooser when non-BAR armor is chosen, to prevent confusion and also stop random fiddling with the chooser causing the Chassis Tech Rating (and thus weight) to fluctuate.
Testing: